# Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
  
  #routing_navigator :on # turns the routing navigator on for all actions
  
  private
    
  def authenticated
    if session[:user_id] = nil || session[:user_id] = 0 
      return false;
    else
      return true;
    end
  end
  
  def authorize
    unless User.find_by_id(session[:user_id])
      redirect_to(:controller => "users", :action => "login")
    end
  end
  
end